<template>
  <view>
    <!--搜索组件-->
    <view class="search-box">
      <my-search @myclick="gotoSearch"></my-search>
    </view>
    
    <!--轮播图的区域-->
    <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true">
      <swiper-item>
        <navigator class="swiper-item" url="/pages/zhusu/zhusu?activeIndex=1">
          <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/3.png" mode="aspectFill"></image>
        </navigator>
      </swiper-item>
      <swiper-item>
        <navigator class="swiper-item">B</navigator>
      </swiper-item>
      <swiper-item>
        <navigator class="swiper-item">C</navigator>
      </swiper-item>
    </swiper>
    
    <!--分类导航的区域-->
    <view class="nav-list">
      <view class="nav-item" @click="navClickHandler({name: '住宿'})">
        <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/住宿.png" class="nav-img"></image>
        <text>住宿</text>
      </view>
      <view class="nav-item">
        <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/出行.png" class="nav-img"></image>
        <text>出行</text>
      </view>
      <view class="nav-item">
        <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/社交.png" class="nav-img"></image>
        <text>社交</text>
      </view>
      <view class="nav-item">
        <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/就医.png" class="nav-img"></image>
        <text>就医</text>
      </view>
    </view>
    
    
    
    <!--楼层的区域-->
    <view class="floor-list">
      <view class="floor-item">
        <!--楼层标题区域-->
        <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/猜你喜欢.png" class="floor-title"></image>
        <!--楼层图片区域-->
        <view class="floor-img-box">
          <!--左侧大图片的盒子-->
          <navigator class="left-img-box" url="/pages/zhusu/zhusu">
            <image src="https://mp-41dc4eae-bb01-4f7d-a821-2de04f0aa84e.cdn.bspapp.com/socialpilot_image/3.png" style="{width:232rpx}" mode="widthFix"></image>
          </navigator>
          <!--右侧小图片的盒子-->
          <view class="right-img-box">
            <navigator class="right-img-item">
              <image></image>
            </navigator>
          </view>  
        </view>
      </view>
    </view>
    
    
    
  </view>  

</template>

<script>
  export default {
    data() {
      return{
        
      };
    },
    methods: {
      
      //跳转页面
      navClickHandler(item) {
        if(item.name === '住宿'){
          uni.navigateTo({
            url: '/pages/zhusu/zhusu'
          })
        }
      },
      gotoSearch() {
        uni.navigateTo({
          url: '/subpkg/search/search'
        })
      }
      
      
    }
  }
</script>

<style lang="scss">
  swiper {
    height: 350rpx;
    .swiper-item,
    image {
      width: 100%;
      height: 100%;
    }
  }
  .nav-list {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    background: #f8f8f8; 
  }
  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .nav-img {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
  }
  .nav-item text {
    font-size: 15px;
  }  
  .floor-title {
    width: 80%;
    height: 60rpx;
  }
  .search-box {
    position: sticky;
    top: 0;
    z-index: 999;
  }
</style>
